<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>{$head[title]}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta content="{$head[keywords]}" name="keywords" />
<meta content="{$head[description]}" name="description" />
<base href="{SITE_URL}" />
<link href="favicon.ico" rel="shortcut icon" />
<link href="../skin/style.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="{$head[title]}" href="/rss.php?rssid={$catid}" />
<script language="JavaScript" src="misc/config.js"></script>
<script language="JavaScript" src="misc/jquery.min.js"></script>
<script language="JavaScript" src="misc/common.js"></script>


<script type="text/javascript" src="misc/validator.js"></script>
</head>
<body>

{template 'header.html'}


<div class="container">
	
    <div class="main">
    	
        {if $action == 'add'}
        	
            <div class="mod">
            	<div class="head">发布信息</div>
                <div class="body">
                	
                    <form action="?module=member&file=manage&action={$action}&catid={$catid}&modelid={$modelid}" method="post" name="myform"  enctype="multipart/form-data">
                    <table cellpadding="0" cellspacing="1" class="table_form"> 
                        
                        {php //dump($forminfos);}
                        {loop $forminfos[base] $field $info}
                        <tr> 
                          <th width="20%"> {if $info['star']} <font color="red">*</font>{/if} <strong>{$info[name]}</strong><br />
                          {$info[tips]}
                          </th>
                          <td>{$info[form]} </td>
                        </tr>
                        {/loop}
                        <tr> 
                          <td></td>
                          <td> 
                          <input type="hidden" name="forward" value="{$forward}"> 
                          <input type="submit" name="dosubmit" value=" 确定 "> 
                          <input type="reset" name="reset" value=" 清除 ">
                          <input type="button" name="preview" value=" 预览 " onClick="preview_content();">
                          </td>
                        </tr>
                    </table>
                    </form>
            
                </div>
            </div>
            
            
            {elseif $action == 'edit'}
            	
             <div class="mod">
            	<div class="head">修改信息</div>
                <div class="body">
                	<form action="?module=member&file=manage&action={$action}&catid={$catid}&modelid={$modelid}&contentid={$contentid}" method="post" name="myform"  enctype="multipart/form-data">
                    <table cellpadding="0" cellspacing="1" class="table_form">
                        {loop $forminfos $field $info}
                        <tr> 
                          <th width="20%">{if $info['star']} <font color="red">*</font>{/if} <strong>{$info[name]}</strong><br />
                          {$info[tips]}
                          </th>
                          <td>{$info[form]} </td>
                        </tr>
                        {/loop}
                        <tr> 
                          <td></td>
                          <td> 
                          <input type="hidden" name="forward" value="{$forward}"> 
                          <input type="submit" name="dosubmit" value=" 确定 "> 
                          <input type="reset" name="reset" value=" 清除 ">
                          <input type="button" name="preview" value=" 预览 " onClick="preview_content();">
                          </td>
                        </tr>
                    </table>
                    </form>
                </div>
            </div>
            
            
            {elseif $action == 'preview'}
            
            <div class="mod">
            	<div class="head">预览信息</div>
                <div class="body">
                	<table cellpadding="0" cellspacing="1" class="table_form">
                        {loop $info $k $v}
                        <tr> 
                          <th width="25%"><b>{$fields[$k][name]}：</b></th>
                          <td>{$v}</td>
                        </tr>
                        {/loop}
                    </table>
                </div>
            </div>
            
            {else}
            
            {if !$catid || $child}
            
            <div class="mod">
            	<div class="head">信息管理</div>
                <div class="body">
                	<table cellpadding="0" cellspacing="1" class="table_list">
                         <tr>
                            <th>栏目</th>
                            <th>信息数</th>
                            <th>管理操作</th>
                         </tr>
                         {$categorys}
                    </table>
                </div>
            </div>
            
            {else}
            
            <div class="mod">
            	<div class="head">管理信息</div>
                <div class="body">
                	
                    <form name="myform" method="post" action="?module=member&file=manage&action=delete" >
                    <table cellpadding="0" cellspacing="1" class="table_list">
                        <tr>
                        {if $status!=99}
                        <th width="40">选中</th>
                        {/if}
                        <th width="45">ID</th>
                        <th>标题</th>
                        <th width="70">更新时间</th>
                        <th width="120">管理操作</th>
                        </tr>
                        {loop $data $r}
                        <tr>
                        {if $status!=99}
                        <td><input type="checkbox" name="contentid[]" value="{$r[contentid]}" id="content_{$r[contentid]}" /></td>
                        {/if}
                        <td>{$r[contentid]}</td>
                        <td><a href="{$r[url]}" target="_blank">{output::style($r['title'], $r['style'])}</a></td>
                        <td>{date('Y-m-d',$r[updatetime])}</td>
                        <td>
                        <a href="?module=member&file=manage&action=preview&contentid={$r[contentid]}">预览</a> 
                        {if $status!=99}
                        | <a href="?module=member&file=manage&action=edit&contentid={$r[contentid]}">修改</a> | 
                        <a href="javascript:if(confirm('确定要删除吗？')) location='?module=member&file=manage&action=delete&contentid={$r[contentid]}'">删除</a> 
                        
                        {/if}
                        </td>
                        </tr>
                        {/loop}
                    </table>
                        <div>
                        {if $status!=99}<input type="submit" name="button2" id="button" value="删除信息" />{/if}
                        </div>
                    </form>
            
                </div>
            </div>
            
            <div class="pagination"><?=$c->pages?></div>
            
            {/if}
            
            {/if}


    </div>
    
    
    <div class="aside">
    	
        <div class="mod">
            <div class="head">信息管理</div>
            <div class="body">
                <ul>
                    <li><a href="?module=member&file=manage&action=add&catid={$catid}">发布信息</a></li>
                    {loop $STATUS $k $name}
                    <li><a href="?module=member&file=manage&status={$k}">{$name}</a></li>
                    {/loop}
                    
                      <li><a href="">返回网站首页</a></li>
                      <li><a href="?module=member&action=logout">退出登录</a></li>
                </ul>
            </div>
        </div> 
          
         
    </div>
    
    
</div>
 

 
<script LANGUAGE="javascript">
<!--
function preview_content()
{
	myform.action = "?module=member&file=manage&action={$action}&catid={$catid}&modelid={$modelid}&contentid={$contentid}";
	myform.target = "_blank"; 
	myform.submit(); 
}

$().ready(function() {
	$('form').checkForm(1);
{loop $member_detail $field $detail}
	$('#{$field}').val('{$detail}');
{/loop}
	});
//-->
</script>
{template 'footer.html'}